import math
import 碰撞检测 as crashCheck

a = 0.55 / (2 * math.pi)


def getCrashBoard(dots, resultIndexs, targetIndex):
    indexLen = len(resultIndexs)
    crashBoard = []
    for i in range(indexLen - 1):
        L1 = 0
        if targetIndex == 0:
            L1 = 2.86
        else:
            L1 = 1.65
        flag = crashCheck.isPengZhuang(dots[resultIndexs[i]], dots[resultIndexs[i + 1]], dots[targetIndex],
                                       dots[targetIndex + 1], 1.65, L1)
        if flag:
            crashBoard.append([resultIndexs[i], resultIndexs[i + 1]])
            crashBoard.append([targetIndex, (targetIndex + 1)])

    return crashBoard
